Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

47 support reading of lists in custom xyz files #48

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

YHordijk
Copy link
Contributor

No description provided.

@YHordijk YHordijk added the enhancement New feature or request label Oct 24, 2023
@YHordijk YHordijk self-assigned this Oct 24, 2023
@YHordijk YHordijk linked an issue Oct 24, 2023 that may be closed by this pull request
…o for copy.deepcopy function that plams often uses. Currently it simply returns the name and namespace of the class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of reduce? Do we use pickling or so?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plams uses the copy module from Python to copy molecule objects, however weird classes like Result may give problems with the copy.deepcopy function. To fix that we have to overload __reduce__ or __reduce_ex__. You can try to copy a molecule read by TCutility.molecule.read and then try to call its copy method. If you do not define __reduce__ in the Result class you will get an error.

@YHordijk YHordijk linked an issue Oct 25, 2023 that may be closed by this pull request
@ToriGijzen ToriGijzen merged commit 4fa494f into main Oct 25, 2023
6 checks passed
@ToriGijzen ToriGijzen deleted the 47-support-reading-of-lists-in-custom-xyz-files branch October 25, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying of molecule objects loaded from custom xyz files fails Support reading of lists in custom xyz-files
3 participants